using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Interpolation
{
    /// <summary>
    /// <para>Diffusion Interpolation With Barriers</para>
    /// <para>Interpolates a surface using a kernel that is based upon the heat equation and allows one to use raster and feature  barriers to redefine distances between input points.</para>
    /// <para>使用基于热方程的核对表面进行插值，并允许使用栅格和要素障碍来重新定义输入点之间的距离。</para>
    /// </summary>    
    [DisplayName("Diffusion Interpolation With Barriers")]
    public class DiffusionInterpolationWithBarriers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DiffusionInterpolationWithBarriers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input features</para>
        /// <para>The input point features containing the z-values to be interpolated.</para>
        /// <para>包含要插值的 z 值的输入点要素。</para>
        /// </param>
        /// <param name="_z_field">
        /// <para>Z value field</para>
        /// <para>Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the input features contain z-values or m-values.</para>
        /// <para>保存每个点的高度或大小值的字段。这可以是数值字段，也可以是形状字段（如果输入要素包含 z 值或 m 值）。</para>
        /// </param>
        public DiffusionInterpolationWithBarriers(object _in_features, object _z_field)
        {
            this._in_features = _in_features;
            this._z_field = _z_field;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Diffusion Interpolation With Barriers";

        public override string CallName => "ga.DiffusionInterpolationWithBarriers";

        public override List<string> AcceptEnvironments => ["cellSize", "coincidentPoints", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "snapRaster", "workspace"];

        public override object[] ParameterInfo => [_in_features, _z_field, _out_ga_layer, _out_raster, _cell_size, _in_barrier_features, _bandwidth, _number_iterations, _weight_field, _in_additive_barrier_raster, _in_cumulative_barrier_raster, _in_flow_barrier_raster];

        /// <summary>
        /// <para>Input features</para>
        /// <para>The input point features containing the z-values to be interpolated.</para>
        /// <para>包含要插值的 z 值的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Z value field</para>
        /// <para>Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the input features contain z-values or m-values.</para>
        /// <para>保存每个点的高度或大小值的字段。这可以是数值字段，也可以是形状字段（如果输入要素包含 z 值或 m 值）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _z_field { get; set; }


        /// <summary>
        /// <para>Output geostatistical layer</para>
        /// <para>The geostatistical layer produced. This layer is required output only if no output raster is requested.</para>
        /// <para>生成的地统计图层。仅当未请求输出栅格时，此图层才是必需的输出。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output geostatistical layer")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_ga_layer { get; set; } = null;


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster. This raster is required output only if no output geostatistical layer is requested.</para>
        /// <para>输出栅格。仅当未请求输出地统计图层时，此栅格才是必需的输出。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_raster { get; set; } = null;


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size at which the output raster will be created.</para>
        ///   <para>This value can be explicitly set in the Environments by the Cell Size parameter.</para>
        ///   <para>If not set, it is the shorter of the width or the height of the extent of the input point features, in the input spatial reference, divided by 250.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建输出栅格的像元大小。</para>
        ///   <para>此值可以通过像元大小参数在“环境”中显式设置。</para>
        ///   <para>如果未设置，则为输入空间参考中输入点要素范围的宽度或高度除以 250 的较短者。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Input absolute barrier features</para>
        /// <para>Absolute barrier features using non-Euclidean distances rather than line-of-sight distances.</para>
        /// <para>使用非欧几里得距离而不是视线距离的绝对屏障要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input absolute barrier features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_barrier_features { get; set; } = null;


        /// <summary>
        /// <para>Bandwidth</para>
        /// <para>Used to specify the maximum distance at which data points are used for prediction. With increasing bandwidth, prediction bias increases and prediction variance decreases.</para>
        /// <para>用于指定数据点用于预测的最大距离。随着带宽的增加，预测偏差增加，预测方差减小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bandwidth")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _bandwidth { get; set; } = null;


        /// <summary>
        /// <para>Number of iterations</para>
        /// <para>The iteration count controls the accuracy of the numerical solution because the model solves the diffusion equation numerically. The larger this number, the more accurate the predictions, yet the longer the processing time. The more complex the barrier's geometry and the larger the bandwidth, the more iterations are required for accurate predictions.</para>
        /// <para>迭代计数控制数值解的精度，因为模型以数值方式求解扩散方程。这个数字越大，预测越准确，但处理时间越长。势垒的几何形状越复杂，带宽越大，准确预测所需的迭代次数就越多。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of iterations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_iterations { get; set; } = 100;


        /// <summary>
        /// <para>Weight field</para>
        /// <para>Used to emphasize an observation. The larger the weight, the more impact it has on the prediction. For coincident observations, assign the largest weight to the most reliable measurement.</para>
        /// <para>用于强调观察结果。权重越大，对预测的影响就越大。对于重合观测值，将最大权重分配给最可靠的测量值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Weight field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _weight_field { get; set; } = null;


        /// <summary>
        /// <para>Input additive barrier raster</para>
        /// <para><xdoc>
        ///   <para>The travel distance from one raster cell to the next based on this formula:</para>
        ///   <para>(average cost value in the neighboring cells) x (distance between cell centers)</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>从一个栅格像元到下一个栅格像元的移动距离基于以下公式：</para>
        ///   <para>（相邻单元格的平均成本值）x （单元中心之间的距离）</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input additive barrier raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_additive_barrier_raster { get; set; } = null;


        /// <summary>
        /// <para>Input cumulative barrier raster</para>
        /// <para><xdoc>
        ///   <para>The travel distance from one raster cell to the next based on this formula:</para>
        ///   <para>(difference between cost values in the neighboring cells) + (distance between cell centers)</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>从一个栅格像元到下一个栅格像元的移动距离基于以下公式：</para>
        ///   <para>（相邻单元中成本值之间的差值）+（单元中心之间的距离）</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cumulative barrier raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_cumulative_barrier_raster { get; set; } = null;


        /// <summary>
        /// <para>Input flow barrier raster</para>
        /// <para><xdoc>
        ///   <para>A flow barrier is used when interpolating data with preferential direction of data variation, based on this formula:</para>
        ///   <para>Indicator (cost values in theneighboring cell > cost values in theneighboring cell) * (cost values in theneighboring cell - cost values in theneighboring cell) + (distance between cell centers),
        ///   <italics>to</italics>
        ///   <italics>from</italics>
        ///   <italics>to</italics>
        ///   <italics>from</italics>
        ///   </para>
        ///   <para>where indicator(true) = 1 and indicator(false) = 0.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>根据以下公式，在以数据变化的优先方向插值数据时，使用流量屏障：</para>
        /// <para>指示器（相邻单元中的成本值>相邻单元中的成本值）*（相邻单元中的成本值 - 相邻单元中的成本值）+（单元中心之间的距离），
        ///   <italics>自</italics>
        ///   <italics>从</italics>
        ///   <italics>自</italics>
        ///   <italics>从</italics>
        ///   </para>
        ///   <para>其中 indicator（true） = 1 和 indicator（false） = 0。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input flow barrier raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_flow_barrier_raster { get; set; } = null;


        public DiffusionInterpolationWithBarriers SetEnv(object cellSize = null, object coincidentPoints = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object snapRaster = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, coincidentPoints: coincidentPoints, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, snapRaster: snapRaster, workspace: workspace);
            return this;
        }

    }

}